import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import {Get} from "@/axios/api.js";
import {ElMessage} from "element-plus";

export const refreshTableData = defineStore('counter', () => {
  const RiverTable = ref([]);
  const GetData = () => {  Get("/River/RiverTable",{}).then((response) => {
    const { code, msg, data: res } = response.data;
    if (code === 200) {
      RiverTable.value=res;
      ElMessage.success(msg ?? "Submitted!");
    } else {
      ElMessage.error(msg);
    }
  });}

  return { RiverTable,GetData }
})
